//
//  ZxFMLoginTableViewController.m
//  XIMaLaYaFM
//
//  Created by fanzhuxian on 2017/8/26.
//  Copyright © 2017年 FanZhuxian. All rights reserved.
//

#import "ZxFMLoginTableViewController.h"

//#import "ZXLoginReigiserViewController.h"
#import "ZXLoginReigiserNavViewController.h"
#import "MineLeftButtonMoveViewController.h"

#import "BtnViewController.h"

@interface ZxFMLoginTableViewController ()

@property (weak, nonatomic) IBOutlet UIView *headView;
@property (weak, nonatomic) IBOutlet UIImageView *headerImage;
@property (weak, nonatomic) IBOutlet UIView *shadowView;

@end

@implementation ZxFMLoginTableViewController

// 隐藏nav
- (void)viewDidAppear:(BOOL)animated {

    self.navigationController.navigationBarHidden = YES;
}

// 电池栏信息高亮状态
- (UIStatusBarStyle)preferredStatusBarStyle {
    return UIStatusBarStyleLightContent;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
//    self.tableView.bounces = NO;

    // 从屏幕顶端开始加载
    self.automaticallyAdjustsScrollViewInsets = NO;
    
    self.headerImage.contentMode = UIViewContentModeScaleAspectFill;
}

#pragma mark - button 点击事件
- (IBAction)didClickLoginBtn:(UIButton *)sender {
    
    NSLog(@"点击了登录");

    ZXLoginReigiserNavViewController * loginReigiserVC = [[ZXLoginReigiserNavViewController alloc] init];
    
    [self presentViewController:loginReigiserVC animated:YES completion:nil];

    
}

- (IBAction)didSetBtnClick:(id)sender {
    
    NSLog(@"点击了设置");
    
    MineLeftButtonMoveViewController * VC = [[MineLeftButtonMoveViewController alloc] init];
    
    self.navigationController.navigationBarHidden = NO;
    
    VC.hidesBottomBarWhenPushed = YES;
    
    [self.navigationController pushViewController:VC animated:YES];
}

- (IBAction)didClickBtn:(id)sender {
    
    NSLog(@"点击按钮");
    
    BtnViewController * btnVC = [[BtnViewController alloc] init];
    
    self.navigationController.navigationBarHidden = NO;
    [self.navigationController pushViewController:btnVC animated:YES];
//    [self presentViewController:btnVC animated:YES completion:nil];
}


#pragma mark - ScrollView 实现下拉放大效果
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
    
    CGPoint point = scrollView.contentOffset;
    if (point.y < 0) {
        CGRect rect = _headerImage.frame;
        rect.origin.y = point.y;
        rect.size.height = - point.y + 310;
        _headerImage.frame = rect;
        
        CGRect shadowRect = self.shadowView.frame;
        shadowRect.origin.y = point.y;
        shadowRect.size.height = - point.y + 310;
        self.shadowView.frame = rect;
        
    }
    
}



@end
